import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { userBlackListVO, userBlackListForm, userBlackListQuery } from '@/api/user/user-black-list/types';

/**
 * 查询人员黑名单列表
 * @param query
 * @returns {*}
 */

export const listuserBlackList = (query?: userBlackListQuery): AxiosPromise<userBlackListVO[]> => {
  return request({
    url: '/user/user-black-list/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询人员黑名单详细
 * @param userBlackListId
 */
export const getuserBlackList = (userBlackListId: string | number): AxiosPromise<userBlackListVO> => {
  return request({
    url: '/user/user-black-list/' + userBlackListId,
    method: 'get'
  });
};

/**
 * 新增人员黑名单
 * @param data
 */
export const adduserBlackList = (data: userBlackListForm) => {
  return request({
    url: '/user/user-black-list',
    method: 'post',
    data: data
  });
};

/**
 * 修改人员黑名单
 * @param data
 */
export const updateuserBlackList = (data: userBlackListForm) => {
  return request({
    url: '/user/user-black-list',
    method: 'put',
    data: data
  });
};

/**
 * 删除人员黑名单
 * @param userBlackListId
 */
export const deluserBlackList = (userBlackListId: string | number | Array<string | number>) => {
  return request({
    url: '/user/user-black-list/' + userBlackListId,
    method: 'delete'
  });
};
